   function chkuser(frm){
  
    if(frm['utype'].value== ""){
       alert("Please insert role name");
        frm['utype'].focus();
         return false;
    }  
  
   var count = 0; 
  for(var i=0;i<frm['chk_role[]'].length;i++)
	  {	   
	  if(frm['chk_role[]'][i].checked == true)
		  {
		   count = count + 1;
		  }
	 }
    if(count == 0)
		  {
          alert("Please select atleast one category");
           return false;
         }  

  } 



function Check(chk)
{
 
  if(document.userfrm.Check_ctr.checked==true){
   
   for (i = 0; i < chk.length; i++)
   //alert("hiiiiiiiii");
    chk[i].checked = true ;
    }else{

   for (i = 0; i < chk.length; i++)
     chk[i].checked = false ;
   }
}
